<!DOCTYPE html>
<html lang="en">

<!-- Mirrored from uxliner.com/adminkit/demo/main/ltr/index.html by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 14 May 2021 17:30:44 GMT -->
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>${title} - 机票预订系统</title>
    <#include "../header.ftl">
    <!-- Left side column. contains the logo and sidebar -->
    <#include "../nav.ftl">

    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <div class="content-header sty-one">
            <h1>${title}</h1>
            <ol class="breadcrumb">
                <li><a href="/admin/index.html">主页</a></li>
                <li><i class="fa fa-angle-right"></i> ${title}</li>
            </ol>
        </div>

        <!-- Main content -->
        <div class="content">
            <div class="card">
                <div class="card-body">
                    <div class="table-responsive">
                        <table class="table table-hover">
                            <thead>
                            <tr>
                                <#--<th scope="col">#</th>-->
                                <th scope="col">航班号</th>
                                <th scope="col">航班公司</th>
                                <th scope="col">出发地</th>
                                <th scope="col">到达地</th>
                                <th scope="col">订单数量</th>
                            </tr>
                            </thead>
                            <tbody>
                            <#if retCode??>
                                <tr>
                                    <td colspan="15" style="text-align:center;">暂无结果展示</td>
                                </tr>
                            <#else>
                                <#if resultList??>
                                    <#list resultList as rs>
                                        <tr>
                                            <#--<th scope="row">${rs['id']}</th>-->
                                            <td>${rs['flight_number']}</td>
                                            <td>${rs['flight_company']}</td>
                                            <td>${rs['departure_place']}</td>
                                            <td>${rs['arrival_place']}</td>
                                            <td>${rs['num']}</td>
                                        </tr>
                                    </#list>
                                </#if>
                            </#if>
                            </tbody>
                        </table>
                    </div>
                    <div style="padding-top:10px; padding-bottom:10px; float:right;">
                        <button type="button" class="btn btn-outline-primary" style="margin-right:10px;"
                                onclick="prePage();" id="btnPrePage">上一页
                        </button>
                        <button type="button" class="btn btn-outline-primary" id="btnNextPage" onclick="nextPage();">
                            下一页
                        </button>
                    </div>
                </div>
            </div>
        </div>
        <!-- /.content -->
    </div>
    <script>
        var thisPageUrl = window.location.href;
        var nowPage = ${pageNow};
        var pageSize = ${pageSize};
        var totalPage = ${totalPage};
        if (thisPageUrl.indexOf("?") > 0) {
            thisPageUrl = thisPageUrl.substring(0, thisPageUrl.indexOf("?"));
        }
        if (nowPage == 1 || totalPage == 0) {
            $("#btnPrePage").removeClass("btn-outline-primary");
            $("#btnPrePage").addClass("btn-outline-secondary");
            $("#btnPrePage").attr("disabled", "disabled");
        }
        if (nowPage == totalPage || totalPage == 0) {
            $("#btnNextPage").removeClass("btn-outline-primary");
            $("#btnNextPage").addClass("btn-outline-secondary");
            $("#btnNextPage").attr("disabled", "disabled");
        }

        function prePage() {
            let contPage = nowPage - 1;
            if (contPage < 1) {
                contPage = 1;
            }
            thisPageUrl = thisPageUrl + "?pageNow=" + contPage + "&pageSize=" + pageSize;
            window.location.href = thisPageUrl;
        }

        function nextPage() {
            let contPage = nowPage + 1;
            thisPageUrl = thisPageUrl + "?pageNow=" + contPage + "&pageSize=" + pageSize;
            window.location.href = thisPageUrl;
        }

        initData();

        function initData() {
            <#if departurePlace??>
            let departurePlace = "${departurePlace}";
            $("#departurePlace").val(departurePlace);
            </#if>
            <#if arrivalPlace??>
            let arrivalPlace = "${arrivalPlace}";
            $("#arrivalPlace").val(arrivalPlace);
            </#if>
            <#if departureDate??>
            let departureDate = "${departureDate}";
            $("#departureDate").val(departureDate);
            </#if>
        }
    </script>
    <#include "../footer.ftl">
</html>